| Conditions | 2 |
| Paths | 3 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | /** global: GLSR, jQuery */ |
||
| 6 | GLSR.Ajax = { |
||
| 7 | /** @return void */ |
||
| 8 | post: function( request, callback ) { // object, function|void |
||
| 9 | var data = { |
||
| 10 | action: GLSR.action, |
||
| 11 | request: request, |
||
| 12 | }; |
||
| 13 | x.post( GLSR.ajaxurl, data, function( response ) { |
||
| 14 | if( typeof callback !== 'function' )return; |
||
| 15 | callback( response ); |
||
| 16 | }); |
||
| 17 | }, |
||
| 18 | |||
| 19 | /** @return void */ |
||
| 20 | postFromEvent: function( ev, request, callback ) { // Event, object, function|void |
||
| 21 | ev.preventDefault(); |
||
| 22 | var el = x( ev.target ); |
||
| 23 | if( el.is( ':disabled' ))return; |
||
| 39 |